// 假设有四张图片代表行走周期的不同阶段
var walkFrames:[SKTexture] = []
for i in 1...4 {
    let textureName = String(format:"walk_%d",i)
    walkFrames.append(SKTexture(imageNamed:textureName))
}

// 使用这些帧制作连续播放的循环动画
let walkingAction = SKAction.repeatForever(
    SKAction.animate(with: walkFrames,
                     timePerFrame: 0.1,
                     resize: false,
                     restore: true))
characterNode.run(walkingAction)